package com.zp.generic;

public class GenericTest<T> {
	private T[] array;

	public T[] getArray() {
		return array;
	}

	public void setArray(T[] array) {
		this.array = array;
	}
	
	public static void main(String[] args) {
		GenericTest<String> g = new GenericTest<String>();
		String[] str1 = {"a","b","c"};
		String[] str2 = null; //局部变量必须得初始化；
		g.setArray(str1);
		str2 = g.getArray();
		
		for(int i=0;i<str2.length;i++){
			System.out.println(str2[i]);
		}
	}
}
